package org.example.model.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author weigang
 * @create 2022-10-28 16:24
 */
@Configuration
@Slf4j
@Setter
@Getter
public class SysConfig {

    @Value("${wg.front.domain}")
    private String frontDomain; // 多环境时，跳转页面需要配置不同的路径

    @Value("${wg.end.domain}")
    private String endDomain;

    @Value("${wg.url.content.page}")
    private String pageContentUrl;

    @Value("${wg.url.checkContent.page}")
    private String checkPageContentUrl;

    @Value("${wg.aes.key}")
    private String aesKey;

    @PostConstruct
    public void init() {
        pageContentUrl = frontDomain + pageContentUrl;
        checkPageContentUrl = endDomain + checkPageContentUrl;
        log.info("UrlConfig, pageContentUrl:{}, checkPageContentUrl:{}", pageContentUrl, checkPageContentUrl);
    }

}
